import React, { Component } from 'react'
import { Switch, Route, NavLink } from 'react-router-dom'
import Small1 from './Small1'
import Small2 from './Small2'
import Small3 from './Small3'

export default class Big extends Component {
    render() {
        return (
            <div>
                <p>我是父组件，我的页面嵌套了子组件</p>
                <Switch>
                    <Route path='/big/small1' exact component={Small1} />
                    <Route path='/big/small2' component={Small2} />
                    <Route path='/big/small3' component={Small3} />
                </Switch>
                <NavLink to='/big/small1'>Small1</NavLink>
                <NavLink to='/big/small2'>Small2</NavLink>
                <NavLink to='/big/small3'>Small3</NavLink>
            </div>
        )
    }
}
